<?
include("../config.php");

$sql = mysql_query("SELECT * FROM phpbb_posts_text,phpbb_posts WHERE `post_text` LIKE CONVERT( _utf8 '%disneymagicwebsites.com/forumdlrpmi%'
USING latin1 ) COLLATE latin1_swedish_ci AND phpbb_posts.post_id = phpbb_posts_text.post_id") or die (mysql_error());
$i = 0;
while($post = mysql_fetch_assoc($sql))
{
	$i++;
	echo '<li>'.$i.'<a href="http://www.disneymagicinteractive.com/forum/viewtopic.php?p='.$post['post_id'].' target="_blank">'.$post['post_subject'].'</a><br>';
	$text = str_replace('disneymagicwebsites.com/forumdlrpmi','disneymagicinteractive.com/forum',$post['post_text']) or die('Erreur !');
	$update = mysql_query("UPDATE phpbb_posts_text SET post_text = '".addslashes($text)."' WHERE post_id = '".$post['post_id']."'") or die (mysql_error());
}	
?>